#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/22 14:03
# @Author: scg
# @Email: xxx@gmail.com
# @File：run.py
import unittest
from cases.test_clue import TestClue
from BeautifulReport import BeautifulReport
from config.config import REPORT_PATH,CASES_PATH
from tools.utils import get_cookie
from tools import globalvar as gl

# suite = unittest.TestSuite()

# suite.addTest(TestClue("test_clue_add"))

# 执行用例之前，生成新的cookie
suite = unittest.defaultTestLoader.discover(CASES_PATH,pattern='test_clue.py')
cookie = get_cookie()
# 把cookie写入 全局变量
gl.init()
gl.set_value('cookie', cookie)

print("--------", gl.get_value('cookie'))

runner = BeautifulReport(suite)
runner.report(description="xxxxxxxxxxx",
              report_dir=REPORT_PATH,
              filename='xxxxx.html')
